/*
 * GameObjectBuilder.java
 *
 * Created on 28. April 2007, 18:58
 */

package de.tor.util;

import de.tor.util.helpers.EnemyHelper;
import de.tor.util.helpers.EnemyWeaponHelper;
import de.tor.util.helpers.ExtensibleHelper;
import de.tor.util.helpers.ExtensionHelper;
import de.tor.util.helpers.ProjectileHelper;
import de.tor.util.helpers.ShrapnelHelper;
import de.tor.util.helpers.WeaponBehaviorHelper;
import de.tor.util.helpers.SpriteHelper;
import de.tor.util.helpers.WeaponHelper;
import de.tor.util.helpers.WorldObjectHelper;
import java.awt.Color;
import java.awt.Cursor;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.ObjectInputStream;
import java.io.ObjectOutputStream;
import java.util.Enumeration;
import java.util.Hashtable;
import java.util.LinkedList;
import java.util.List;
import javax.imageio.ImageIO;
import javax.swing.DefaultComboBoxModel;
import javax.swing.DefaultListModel;
import javax.swing.ImageIcon;
import javax.swing.JFileChooser;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.table.DefaultTableModel;

/**
 *
 * @author  Charon
 */
public class EnemyEditor extends javax.swing.JFrame {
    
    
    final String OBJECTS_FILE = "objects.std";
    final String MOVEMENTS_FILE = "movements.std";
    final String WEAPONS_FILE = "weapons.std";
    final String PROJECTILE_FILE = "projectiles.std";
    
    final int WEAPON_COL = 0;
    final int DX_COL = 1;
    final int DY_COL = 2;
    final int PROJECTILE_COL = 3;
    
    final int ENEMY_COL = 0;
    final int XPOS_COL = 1;
    final int YPOS_COL = 2;
    
    private String mObjPath= null;
    
    private Hashtable<String, EnemyHelper> enemies;
    private Hashtable<String, WeaponHelper> weapons;
    private Hashtable<String, ProjectileHelper> projectiles;
    private Hashtable<String, WorldObjectHelper> worldObjects;
    
    private DefaultListModel mObjectModel;
    private DefaultComboBoxModel mProjectileGroupsModel = null;
    private BufferedImage mCurrentPreview = null;
    private int mPreviewW = 1;
    private int mPreviewH = 1;
    private int mPreviewXCount = 1;
    private int mPreviewYCount = 1;
    
    /** Creates new form GameObjectBuilder */
    public EnemyEditor() {
        initComponents();
        enemies = new Hashtable();
        weapons = new Hashtable();
        projectiles = new Hashtable();
        worldObjects = new Hashtable();
        
        mObjectModel = new DefaultListModel();
        mProjectileGroupsModel = new DefaultComboBoxModel();
        jProjectileGroupSelectionWeapon.setModel(mProjectileGroupsModel);
        jProjectileGroup.setModel(mProjectileGroupsModel);
        
        jEnemiesList.setModel(mObjectModel);
        jWeaponList.setModel(new DefaultListModel());
        jProjectileList.setModel(new DefaultListModel());
        jWorldObjectList.setModel(new DefaultListModel());
        
        createTestData();
        
        jWeaponEditor.pack();
        jWeaponAddFrame.pack();
        jProjectileEditor.pack();
        jWorldObjectEditor.pack();
        jExtensionAddFrame.pack();
    }
    
    private void createTestData(){
        WeaponHelper w1 = new WeaponHelper();
        w1.setName("DummyWeapon");
        w1.setProjectileGroup("Dummy");
        weapons.put("DummyWeapon", w1);
        
        WeaponHelper w2 = new WeaponHelper();
        w2.setName("RocketLauncher");
        w2.setProjectileGroup("Rocket");
        weapons.put("RocketLauncher", w2);
        
        mProjectileGroupsModel.addElement("Rocket");
        mProjectileGroupsModel.addElement("Dummy");
        
        ((DefaultListModel)jWeaponList.getModel()).addElement(w1.getName());
        ((DefaultListModel)jWeaponList.getModel()).addElement(w2.getName());
        
        ProjectileHelper p1 = new ProjectileHelper();
        p1.setProjectileGroup("Dummy");
        p1.setName("DummyProjectile");
        projectiles.put("DummyProjectile", p1);
        
        ProjectileHelper p2 = new ProjectileHelper();
        p2.setProjectileGroup("Dummy");
        p2.setName("DummyProjectile2");
        projectiles.put("DummyProjectile2", p2);
        
        ProjectileHelper p3 = new ProjectileHelper();
        p3.setProjectileGroup("Rocket");
        p3.setName("RocketProjectile");
        projectiles.put("RocketProjectile", p3);
        
        ((DefaultListModel)jProjectileList.getModel()).addElement(p1.getName());
        ((DefaultListModel)jProjectileList.getModel()).addElement(p2.getName());
        ((DefaultListModel)jProjectileList.getModel()).addElement(p3.getName());
        
        EnemyHelper testEnemy = new EnemyHelper();
        
        testEnemy.setName("TestEnemy");
        testEnemy.setCollisionDamage(10);
        testEnemy.setMaxHealth(100);
        SpriteHelper sH = new SpriteHelper();
        sH.setPath("h:/Software/SpaceTiger/src/de/tor/resources/asteroid1.png");
        sH.setSpritesX(15);
        sH.setSpritesY(1);
        sH.setTransparencyUsed(true);
        testEnemy.setViewSprite(sH);
        testEnemy.setIsDestroyable(true);
        EnemyWeaponHelper weapon = new EnemyWeaponHelper();
        weapon.setWeapon(w1);
        weapon.setProjectile(p1);
        weapon.setDx(0);
        weapon.setDy(0);
        testEnemy.addWeapon(weapon);
        ((DefaultListModel)jEnemiesList.getModel()).addElement(testEnemy.getName());
        enemies.put("TestEnemy", testEnemy);
    }
    
    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    // <editor-fold defaultstate="collapsed" desc=" Generated Code ">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPreviewFrame = new javax.swing.JFrame();
        jPreviewLabel = new javax.swing.JLabel();
        jPreviewSlider = new javax.swing.JSlider();
        jWeaponEditor = new javax.swing.JFrame();
        jScrollPane3 = new javax.swing.JScrollPane();
        jWeaponList = new javax.swing.JList();
        jAddModifyWeapon = new javax.swing.JButton();
        jEditorRemoveWeapon = new javax.swing.JButton();
        jLabel12 = new javax.swing.JLabel();
        jWeaponName = new javax.swing.JTextField();
        jLabel13 = new javax.swing.JLabel();
        jProjectileGroupSelectionWeapon = new javax.swing.JComboBox();
        jAddProjectileGroup = new javax.swing.JButton();
        jRemoveProjectileGroup = new javax.swing.JButton();
        jProjectileGroupName = new javax.swing.JTextField();
        jProjectileEditor = new javax.swing.JFrame();
        jScrollPane4 = new javax.swing.JScrollPane();
        jProjectileList = new javax.swing.JList();
        jRemoveProjectile = new javax.swing.JButton();
        jAddModifyProjectile = new javax.swing.JButton();
        jLabel15 = new javax.swing.JLabel();
        jProjectileName = new javax.swing.JTextField();
        jPanel2 = new javax.swing.JPanel();
        jLoadSpriteProjectile = new javax.swing.JButton();
        jSpritePathProjectile = new javax.swing.JTextField();
        jLabel17 = new javax.swing.JLabel();
        jLabel18 = new javax.swing.JLabel();
        jXCountSpriteProjectile = new javax.swing.JTextField();
        jLabel19 = new javax.swing.JLabel();
        jYCountSpriteProjectile = new javax.swing.JTextField();
        jSpriteTransProjectile = new javax.swing.JCheckBox();
        jPreviewSpriteProjectile = new javax.swing.JButton();
        jDestPathProjectile = new javax.swing.JTextField();
        jLabel20 = new javax.swing.JLabel();
        jLoadDestProjectile = new javax.swing.JButton();
        jPreviewDestProjectile = new javax.swing.JButton();
        jLabel21 = new javax.swing.JLabel();
        jXCountDestProjectile = new javax.swing.JTextField();
        jLabel22 = new javax.swing.JLabel();
        jYCountDestProjectile = new javax.swing.JTextField();
        jDestTransProjectile = new javax.swing.JCheckBox();
        jLabel16 = new javax.swing.JLabel();
        jProjectileDamage = new javax.swing.JTextField();
        jPanel3 = new javax.swing.JPanel();
        jProjectilePiercing = new javax.swing.JCheckBox();
        jPanel4 = new javax.swing.JPanel();
        jEnableShrapnel = new javax.swing.JCheckBox();
        jLabel23 = new javax.swing.JLabel();
        jShrapnelCount = new javax.swing.JTextField();
        jLabel24 = new javax.swing.JLabel();
        jShrapnelDirection = new javax.swing.JComboBox();
        jLabel25 = new javax.swing.JLabel();
        jLabel26 = new javax.swing.JLabel();
        jFanDegree = new javax.swing.JTextField();
        jLabel27 = new javax.swing.JLabel();
        jShrapnelProjectile = new javax.swing.JComboBox();
        jProjectileBouncing = new javax.swing.JCheckBox();
        jProjectileTracking = new javax.swing.JCheckBox();
        jLabel30 = new javax.swing.JLabel();
        jProjectileGroup = new javax.swing.JComboBox();
        jLabel50 = new javax.swing.JLabel();
        jProjectileStartSpeed = new javax.swing.JTextField();
        jLabel51 = new javax.swing.JLabel();
        jProjectileSpeedInc = new javax.swing.JTextField();
        jLabel52 = new javax.swing.JLabel();
        jProjectileMaxSpeed = new javax.swing.JTextField();
        jLabel53 = new javax.swing.JLabel();
        jShotsPerSecond = new javax.swing.JTextField();
        jWeaponAddFrame = new javax.swing.JFrame();
        jWeaponSelection = new javax.swing.JComboBox();
        jLabel31 = new javax.swing.JLabel();
        jLabel32 = new javax.swing.JLabel();
        jWeaponDX = new javax.swing.JTextField();
        jWeaponDY = new javax.swing.JTextField();
        jLabel33 = new javax.swing.JLabel();
        jLabel34 = new javax.swing.JLabel();
        jSupportedProjectiles = new javax.swing.JComboBox();
        jDoAddWeapon = new javax.swing.JButton();
        jCloseAddEnemyFrame = new javax.swing.JButton();
        jWorldObjectEditor = new javax.swing.JFrame();
        jScrollPane5 = new javax.swing.JScrollPane();
        jWorldObjectList = new javax.swing.JList();
        jRemoveWorldObject = new javax.swing.JButton();
        jAddModifyWorldObject = new javax.swing.JButton();
        jLabel36 = new javax.swing.JLabel();
        jWorldObjectName = new javax.swing.JTextField();
        jPanel5 = new javax.swing.JPanel();
        jLabel37 = new javax.swing.JLabel();
        jWorldObjectSprite = new javax.swing.JTextField();
        jLoadWorldObjectSprite = new javax.swing.JButton();
        jLabel38 = new javax.swing.JLabel();
        jXCountWorldObjectSprite = new javax.swing.JTextField();
        jLabel39 = new javax.swing.JLabel();
        jYCountWorldObjectSprite = new javax.swing.JTextField();
        jTransparencyWorldObjectSprite = new javax.swing.JCheckBox();
        jPreviewWorldObjectSprite = new javax.swing.JButton();
        jLabel44 = new javax.swing.JLabel();
        jScrollPane6 = new javax.swing.JScrollPane();
        jWorldObjectExtensions = new javax.swing.JTable();
        jAddWorldObjectExtension = new javax.swing.JButton();
        jRemoveWorldObjectExtension = new javax.swing.JButton();
        jExtensionAddFrame = new javax.swing.JFrame();
        jLabel47 = new javax.swing.JLabel();
        jEnemySelection = new javax.swing.JComboBox();
        jLabel48 = new javax.swing.JLabel();
        jExtensionXPos = new javax.swing.JTextField();
        jLabel49 = new javax.swing.JLabel();
        jExtensionYPos = new javax.swing.JTextField();
        jCloseExtensionFrame = new javax.swing.JButton();
        jAddExtension = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jScrollPane1 = new javax.swing.JScrollPane();
        jEnemiesList = new javax.swing.JList();
        jName = new javax.swing.JTextField();
        jLabel5 = new javax.swing.JLabel();
        jMaxHealth = new javax.swing.JTextField();
        jLabel8 = new javax.swing.JLabel();
        jCollisionDamage = new javax.swing.JTextField();
        jLabel6 = new javax.swing.JLabel();
        jAddWeapon = new javax.swing.JButton();
        jRemoveEnemyWeapon = new javax.swing.JButton();
        jAddModifyEnemy = new javax.swing.JButton();
        jRemoveEnemy = new javax.swing.JButton();
        jPanel1 = new javax.swing.JPanel();
        jLoadSprite = new javax.swing.JButton();
        jSpritePath = new javax.swing.JTextField();
        jLabel2 = new javax.swing.JLabel();
        jLabel7 = new javax.swing.JLabel();
        jXCountSprite = new javax.swing.JTextField();
        jLabel9 = new javax.swing.JLabel();
        jYCountSprite = new javax.swing.JTextField();
        jSpriteTrans = new javax.swing.JCheckBox();
        jPreviewSprite = new javax.swing.JButton();
        jDestPath = new javax.swing.JTextField();
        jLabel3 = new javax.swing.JLabel();
        jLoadDest = new javax.swing.JButton();
        jPreviewDest = new javax.swing.JButton();
        jLabel10 = new javax.swing.JLabel();
        jXCountDest = new javax.swing.JTextField();
        jLabel11 = new javax.swing.JLabel();
        jYCountDest = new javax.swing.JTextField();
        jDestTrans = new javax.swing.JCheckBox();
        jScrollPane2 = new javax.swing.JScrollPane();
        jWeaponsTable = new javax.swing.JTable();
        jLabel35 = new javax.swing.JLabel();
        jTrackPlayer = new javax.swing.JCheckBox();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenuItem1 = new javax.swing.JMenuItem();
        jMenuItem3 = new javax.swing.JMenuItem();
        jSeparator1 = new javax.swing.JSeparator();
        jMenuItem2 = new javax.swing.JMenuItem();
        jMenu2 = new javax.swing.JMenu();
        jShowWeaponEditor = new javax.swing.JCheckBoxMenuItem();
        jShowProjectileEditor = new javax.swing.JCheckBoxMenuItem();
        jShowWorldObjectEditor = new javax.swing.JCheckBoxMenuItem();

        jPreviewFrame.setTitle("Preview");

        jPreviewSlider.setMajorTickSpacing(1);
        jPreviewSlider.setMinorTickSpacing(1);
        jPreviewSlider.setValue(1);
        jPreviewSlider.addChangeListener(new javax.swing.event.ChangeListener() {
            public void stateChanged(javax.swing.event.ChangeEvent evt) {
                fireUpdatePreviewEvent(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPreviewFrameLayout = new org.jdesktop.layout.GroupLayout(jPreviewFrame.getContentPane());
        jPreviewFrame.getContentPane().setLayout(jPreviewFrameLayout);
        jPreviewFrameLayout.setHorizontalGroup(
            jPreviewFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPreviewFrameLayout.createSequentialGroup()
                .addContainerGap()
                .add(jPreviewFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPreviewLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jPreviewSlider, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 380, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPreviewFrameLayout.setVerticalGroup(
            jPreviewFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jPreviewFrameLayout.createSequentialGroup()
                .addContainerGap()
                .add(jPreviewLabel, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 243, Short.MAX_VALUE)
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                .add(jPreviewSlider, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );

        jWeaponEditor.setTitle("Weapon Editor");
        jWeaponEditor.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                fireFrameClosedEvent(evt);
            }
        });

        jWeaponList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                fireListSelectionChangedEvent(evt);
            }
        });
        jScrollPane3.setViewportView(jWeaponList);

        jAddModifyWeapon.setText("Add/Modify");
        jAddModifyWeapon.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddModifyObjectEvent(evt);
            }
        });

        jEditorRemoveWeapon.setText("Remove");
        jEditorRemoveWeapon.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireRemoveObjectEvent(evt);
            }
        });

        jLabel12.setText("Name");

        jLabel13.setText("Proj. Group");

        jAddProjectileGroup.setText("+");
        jAddProjectileGroup.setMargin(new java.awt.Insets(2, 0, 2, 0));
        jAddProjectileGroup.setMaximumSize(new java.awt.Dimension(23, 23));
        jAddProjectileGroup.setMinimumSize(new java.awt.Dimension(23, 23));
        jAddProjectileGroup.setPreferredSize(new java.awt.Dimension(23, 23));
        jAddProjectileGroup.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireModifyProjectileGroupEvent(evt);
            }
        });

        jRemoveProjectileGroup.setText("-");
        jRemoveProjectileGroup.setMargin(new java.awt.Insets(2, 0, 2, 0));
        jRemoveProjectileGroup.setMaximumSize(new java.awt.Dimension(23, 23));
        jRemoveProjectileGroup.setMinimumSize(new java.awt.Dimension(23, 23));
        jRemoveProjectileGroup.setPreferredSize(new java.awt.Dimension(23, 23));
        jRemoveProjectileGroup.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireModifyProjectileGroupEvent(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jWeaponEditorLayout = new org.jdesktop.layout.GroupLayout(jWeaponEditor.getContentPane());
        jWeaponEditor.getContentPane().setLayout(jWeaponEditorLayout);
        jWeaponEditorLayout.setHorizontalGroup(
            jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jWeaponEditorLayout.createSequentialGroup()
                .addContainerGap()
                .add(jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jEditorRemoveWeapon, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jAddModifyWeapon, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 94, Short.MAX_VALUE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel13)
                    .add(jLabel12))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jWeaponName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 302, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jWeaponEditorLayout.createSequentialGroup()
                        .add(jProjectileGroupName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 244, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jAddProjectileGroup, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jRemoveProjectileGroup, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jProjectileGroupSelectionWeapon, 0, 302, Short.MAX_VALUE))
                .addContainerGap())
        );
        jWeaponEditorLayout.setVerticalGroup(
            jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jWeaponEditorLayout.createSequentialGroup()
                .addContainerGap()
                .add(jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jWeaponEditorLayout.createSequentialGroup()
                        .add(jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jWeaponName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel12))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jWeaponEditorLayout.createSequentialGroup()
                                .add(jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                    .add(jProjectileGroupSelectionWeapon, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jLabel13))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jProjectileGroupName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jWeaponEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(jAddProjectileGroup, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jRemoveProjectileGroup, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                    .add(jWeaponEditorLayout.createSequentialGroup()
                        .add(jScrollPane3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 254, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jAddModifyWeapon)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jEditorRemoveWeapon)))
                .addContainerGap())
        );

        jProjectileEditor.setTitle("Projectile Editor");
        jProjectileEditor.addWindowListener(new java.awt.event.WindowAdapter() {
            public void windowClosing(java.awt.event.WindowEvent evt) {
                fireFrameClosedEvent(evt);
            }
        });

        jProjectileList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                fireListSelectionChangedEvent(evt);
            }
        });
        jScrollPane4.setViewportView(jProjectileList);

        jRemoveProjectile.setText("Remove");
        jRemoveProjectile.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireRemoveObjectEvent(evt);
            }
        });

        jAddModifyProjectile.setText("Add/Modify");
        jAddModifyProjectile.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddModifyObjectEvent(evt);
            }
        });

        jLabel15.setText("Name");

        jPanel2.setBorder(javax.swing.BorderFactory.createTitledBorder("View"));

        jLoadSpriteProjectile.setText("Select");
        jLoadSpriteProjectile.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLoadSpriteProjectilefireSelectSpriteEvent(evt);
            }
        });

        jLabel17.setText("Sprite");

        jLabel18.setText("XCount");

        jXCountSpriteProjectile.setText("1");

        jLabel19.setText("YCount");

        jYCountSpriteProjectile.setText("1");

        jSpriteTransProjectile.setText("Transparency");
        jSpriteTransProjectile.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jSpriteTransProjectile.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jPreviewSpriteProjectile.setText("Preview");
        jPreviewSpriteProjectile.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireShowSpritePreviewEvent(evt);
            }
        });

        jLabel20.setText("Dest. Anim");

        jLoadDestProjectile.setText("Select");
        jLoadDestProjectile.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                jLoadDestProjectilefireSelectSpriteEvent(evt);
            }
        });

        jPreviewDestProjectile.setText("Preview");
        jPreviewDestProjectile.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireShowSpritePreviewEvent(evt);
            }
        });

        jLabel21.setText("XCount");

        jXCountDestProjectile.setText("1");

        jLabel22.setText("YCount");

        jYCountDestProjectile.setText("1");

        jDestTransProjectile.setText("Transparency");
        jDestTransProjectile.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jDestTransProjectile.setMargin(new java.awt.Insets(0, 0, 0, 0));

        org.jdesktop.layout.GroupLayout jPanel2Layout = new org.jdesktop.layout.GroupLayout(jPanel2);
        jPanel2.setLayout(jPanel2Layout);
        jPanel2Layout.setHorizontalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel21)
                    .add(jLabel17)
                    .add(jLabel18)
                    .add(jLabel20))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2Layout.createSequentialGroup()
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jXCountSpriteProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel19)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jYCountSpriteProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jSpriteTransProjectile))
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(jXCountDestProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel22)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jYCountDestProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jDestTransProjectile))
                    .add(jSpritePathProjectile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE)
                    .add(jDestPathProjectile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 462, Short.MAX_VALUE))
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(18, 18, 18)
                        .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                                .add(jLoadDestProjectile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 87, Short.MAX_VALUE)
                                .add(jPreviewDestProjectile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                            .add(jPreviewSpriteProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(jPanel2Layout.createSequentialGroup()
                        .add(18, 18, 18)
                        .add(jLoadSpriteProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );
        jPanel2Layout.setVerticalGroup(
            jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel2Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel17)
                    .add(jSpritePathProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLoadSpriteProjectile))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel18)
                    .add(jLabel19)
                    .add(jYCountSpriteProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jXCountSpriteProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jSpriteTransProjectile)
                    .add(jPreviewSpriteProjectile))
                .add(36, 36, 36)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel20)
                    .add(jDestPathProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLoadDestProjectile))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel2Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel21)
                    .add(jLabel22)
                    .add(jYCountDestProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jXCountDestProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jDestTransProjectile)
                    .add(jPreviewDestProjectile))
                .addContainerGap(28, Short.MAX_VALUE))
        );

        jLabel16.setText("Damage");

        jProjectileDamage.setMaximumSize(new java.awt.Dimension(80, 20));
        jProjectileDamage.setMinimumSize(new java.awt.Dimension(80, 20));
        jProjectileDamage.setPreferredSize(new java.awt.Dimension(80, 20));

        jPanel3.setBorder(javax.swing.BorderFactory.createTitledBorder("Special Behavior"));

        jProjectilePiercing.setText("Piercing");
        jProjectilePiercing.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jProjectilePiercing.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jPanel4.setBorder(javax.swing.BorderFactory.createTitledBorder("Shrapnell"));

        jEnableShrapnel.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jEnableShrapnel.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jLabel23.setText("Count");

        jShrapnelCount.setMaximumSize(new java.awt.Dimension(80, 20));
        jShrapnelCount.setMinimumSize(new java.awt.Dimension(80, 20));
        jShrapnelCount.setPreferredSize(new java.awt.Dimension(80, 20));

        jLabel24.setText("Enable");

        jShrapnelDirection.setModel(new javax.swing.DefaultComboBoxModel(new String[] { "Radial", "Fan", "Random" }));

        jLabel25.setText("Direction");

        jLabel26.setText("Fan Deg.");

        jFanDegree.setMaximumSize(new java.awt.Dimension(80, 20));
        jFanDegree.setMinimumSize(new java.awt.Dimension(80, 20));
        jFanDegree.setPreferredSize(new java.awt.Dimension(80, 20));

        jLabel27.setText("Projectile");

        org.jdesktop.layout.GroupLayout jPanel4Layout = new org.jdesktop.layout.GroupLayout(jPanel4);
        jPanel4.setLayout(jPanel4Layout);
        jPanel4Layout.setHorizontalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel23)
                    .add(jLabel24)
                    .add(jLabel25)
                    .add(jLabel27))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel4Layout.createSequentialGroup()
                        .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPanel4Layout.createSequentialGroup()
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                                    .add(jEnableShrapnel)
                                    .add(jShrapnelCount, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                            .add(jShrapnelDirection, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jLabel26)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jFanDegree, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(jShrapnelProjectile, 0, 464, Short.MAX_VALUE))
                .addContainerGap())
        );
        jPanel4Layout.setVerticalGroup(
            jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel4Layout.createSequentialGroup()
                .add(11, 11, 11)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jEnableShrapnel)
                    .add(jLabel24))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel23)
                    .add(jShrapnelCount, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel25)
                    .add(jLabel26)
                    .add(jFanDegree, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jShrapnelDirection, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel4Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel27)
                    .add(jShrapnelProjectile, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jProjectileBouncing.setText("Bouncing");
        jProjectileBouncing.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jProjectileBouncing.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jProjectileTracking.setText("Tracking");
        jProjectileTracking.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jProjectileTracking.setMargin(new java.awt.Insets(0, 0, 0, 0));

        org.jdesktop.layout.GroupLayout jPanel3Layout = new org.jdesktop.layout.GroupLayout(jPanel3);
        jPanel3.setLayout(jPanel3Layout);
        jPanel3Layout.setHorizontalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jProjectilePiercing)
                    .add(jProjectileBouncing)
                    .add(jProjectileTracking))
                .add(18, 18, 18)
                .add(jPanel4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addContainerGap())
        );
        jPanel3Layout.setVerticalGroup(
            jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel3Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel3Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel4, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jPanel3Layout.createSequentialGroup()
                        .add(jProjectilePiercing)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jProjectileBouncing)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jProjectileTracking)))
                .add(43, 43, 43))
        );

        jLabel30.setText("Group");

        jLabel50.setText("Speed0");

        jProjectileStartSpeed.setText("-0.5");
        jProjectileStartSpeed.setMaximumSize(new java.awt.Dimension(80, 20));
        jProjectileStartSpeed.setMinimumSize(new java.awt.Dimension(80, 20));
        jProjectileStartSpeed.setPreferredSize(new java.awt.Dimension(80, 20));

        jLabel51.setText("SpeedInc");

        jProjectileSpeedInc.setText("0");
        jProjectileSpeedInc.setMaximumSize(new java.awt.Dimension(80, 20));
        jProjectileSpeedInc.setMinimumSize(new java.awt.Dimension(80, 20));
        jProjectileSpeedInc.setPreferredSize(new java.awt.Dimension(80, 20));

        jLabel52.setText("SpeedMax");

        jProjectileMaxSpeed.setText("-0.5");
        jProjectileMaxSpeed.setMaximumSize(new java.awt.Dimension(80, 20));
        jProjectileMaxSpeed.setMinimumSize(new java.awt.Dimension(80, 20));
        jProjectileMaxSpeed.setPreferredSize(new java.awt.Dimension(80, 20));

        jLabel53.setText("Shots/s");

        jShotsPerSecond.setMaximumSize(new java.awt.Dimension(80, 20));
        jShotsPerSecond.setMinimumSize(new java.awt.Dimension(80, 20));
        jShotsPerSecond.setPreferredSize(new java.awt.Dimension(80, 20));

        org.jdesktop.layout.GroupLayout jProjectileEditorLayout = new org.jdesktop.layout.GroupLayout(jProjectileEditor.getContentPane());
        jProjectileEditor.getContentPane().setLayout(jProjectileEditorLayout);
        jProjectileEditorLayout.setHorizontalGroup(
            jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jProjectileEditorLayout.createSequentialGroup()
                .addContainerGap()
                .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jAddModifyProjectile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jRemoveProjectile, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE))
                .add(18, 18, 18)
                .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jProjectileEditorLayout.createSequentialGroup()
                        .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jProjectileEditorLayout.createSequentialGroup()
                                .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jLabel16)
                                    .add(jLabel50))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                                    .add(jProjectileEditorLayout.createSequentialGroup()
                                        .add(jProjectileStartSpeed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                        .add(jLabel51))
                                    .add(jProjectileEditorLayout.createSequentialGroup()
                                        .add(jProjectileDamage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                        .add(jLabel53)))
                                .add(19, 19, 19)
                                .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(jProjectileSpeedInc, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                    .add(jShotsPerSecond, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                                .add(18, 18, 18)
                                .add(jLabel52))
                            .add(jProjectileEditorLayout.createSequentialGroup()
                                .add(jLabel15)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jProjectileName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 316, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jProjectileEditorLayout.createSequentialGroup()
                                .add(jLabel30)
                                .add(18, 18, 18)
                                .add(jProjectileGroup, 0, 255, Short.MAX_VALUE))
                            .add(jProjectileMaxSpeed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel3, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jProjectileEditorLayout.setVerticalGroup(
            jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(org.jdesktop.layout.GroupLayout.TRAILING, jProjectileEditorLayout.createSequentialGroup()
                .addContainerGap()
                .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jProjectileEditorLayout.createSequentialGroup()
                        .add(jScrollPane4, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 477, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jAddModifyProjectile)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jRemoveProjectile))
                    .add(jProjectileEditorLayout.createSequentialGroup()
                        .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel15, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 14, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel30)
                            .add(jProjectileGroup, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jProjectileName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel16)
                            .add(jProjectileDamage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jLabel53)
                            .add(jShotsPerSecond, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel50)
                            .add(jProjectileEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                                .add(jProjectileStartSpeed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jLabel51)
                                .add(jProjectileSpeedInc, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .add(jLabel52)
                                .add(jProjectileMaxSpeed, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel3, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                .addContainerGap())
        );

        jWeaponAddFrame.setTitle("Add Weapon");

        jWeaponSelection.addItemListener(new java.awt.event.ItemListener() {
            public void itemStateChanged(java.awt.event.ItemEvent evt) {
                fireChangeWeaponEvent(evt);
            }
        });

        jLabel31.setText("Weapon");

        jLabel32.setText("DX");

        jWeaponDX.setMaximumSize(new java.awt.Dimension(80, 20));
        jWeaponDX.setMinimumSize(new java.awt.Dimension(80, 20));
        jWeaponDX.setPreferredSize(new java.awt.Dimension(80, 20));

        jWeaponDY.setMaximumSize(new java.awt.Dimension(80, 20));
        jWeaponDY.setMinimumSize(new java.awt.Dimension(80, 20));
        jWeaponDY.setPreferredSize(new java.awt.Dimension(80, 20));

        jLabel33.setText("DY");

        jLabel34.setText("Projectile");

        jDoAddWeapon.setText("Add");
        jDoAddWeapon.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddEnemyWeaponEvent(evt);
            }
        });

        jCloseAddEnemyFrame.setText("Close");
        jCloseAddEnemyFrame.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddEnemyWeaponEvent(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jWeaponAddFrameLayout = new org.jdesktop.layout.GroupLayout(jWeaponAddFrame.getContentPane());
        jWeaponAddFrame.getContentPane().setLayout(jWeaponAddFrameLayout);
        jWeaponAddFrameLayout.setHorizontalGroup(
            jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jWeaponAddFrameLayout.createSequentialGroup()
                .addContainerGap()
                .add(jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jWeaponAddFrameLayout.createSequentialGroup()
                        .add(jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel31)
                            .add(jLabel32)
                            .add(jLabel34))
                        .add(14, 14, 14)
                        .add(jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jWeaponAddFrameLayout.createSequentialGroup()
                                .add(jWeaponDX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jLabel33)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jWeaponDY, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                            .add(jWeaponSelection, 0, 322, Short.MAX_VALUE)
                            .add(jSupportedProjectiles, 0, 322, Short.MAX_VALUE)))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jWeaponAddFrameLayout.createSequentialGroup()
                        .add(jDoAddWeapon)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jCloseAddEnemyFrame)))
                .addContainerGap())
        );
        jWeaponAddFrameLayout.setVerticalGroup(
            jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jWeaponAddFrameLayout.createSequentialGroup()
                .addContainerGap()
                .add(jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel31)
                    .add(jWeaponSelection, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel32)
                    .add(jWeaponDX, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel33)
                    .add(jWeaponDY, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel34)
                    .add(jSupportedProjectiles, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jWeaponAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jCloseAddEnemyFrame)
                    .add(jDoAddWeapon))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jWorldObjectEditor.setTitle("World Object Editor");

        jScrollPane5.setViewportView(jWorldObjectList);

        jRemoveWorldObject.setText("Remove");

        jAddModifyWorldObject.setText("Add/Modify");

        jLabel36.setText("Name");

        jPanel5.setBorder(javax.swing.BorderFactory.createTitledBorder("View"));

        jLabel37.setText("Sprite");

        jLoadWorldObjectSprite.setText("Select");
        jLoadWorldObjectSprite.setMaximumSize(new java.awt.Dimension(73, 23));
        jLoadWorldObjectSprite.setMinimumSize(new java.awt.Dimension(73, 23));
        jLoadWorldObjectSprite.setPreferredSize(new java.awt.Dimension(73, 23));
        jLoadWorldObjectSprite.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireSelectSpriteEvent(evt);
            }
        });

        jLabel38.setText("XCount");

        jXCountWorldObjectSprite.setText("1");
        jXCountWorldObjectSprite.setMaximumSize(new java.awt.Dimension(80, 20));
        jXCountWorldObjectSprite.setMinimumSize(new java.awt.Dimension(80, 20));
        jXCountWorldObjectSprite.setPreferredSize(new java.awt.Dimension(80, 20));

        jLabel39.setText("YCount");

        jYCountWorldObjectSprite.setText("1");
        jYCountWorldObjectSprite.setMaximumSize(new java.awt.Dimension(80, 20));
        jYCountWorldObjectSprite.setMinimumSize(new java.awt.Dimension(80, 20));
        jYCountWorldObjectSprite.setPreferredSize(new java.awt.Dimension(80, 20));

        jTransparencyWorldObjectSprite.setText("Transparency");
        jTransparencyWorldObjectSprite.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jTransparencyWorldObjectSprite.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jPreviewWorldObjectSprite.setText("Preview");
        jPreviewWorldObjectSprite.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireShowSpritePreviewEvent(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jPanel5Layout = new org.jdesktop.layout.GroupLayout(jPanel5);
        jPanel5.setLayout(jPanel5Layout);
        jPanel5Layout.setHorizontalGroup(
            jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel37)
                    .add(jLabel38))
                .add(21, 21, 21)
                .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel5Layout.createSequentialGroup()
                        .add(jXCountWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 80, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel39)
                        .add(18, 18, 18)
                        .add(jYCountWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(18, 18, 18)
                        .add(jTransparencyWorldObjectSprite))
                    .add(jWorldObjectSprite, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 338, Short.MAX_VALUE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPreviewWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLoadWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );
        jPanel5Layout.setVerticalGroup(
            jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel5Layout.createSequentialGroup()
                .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel37)
                    .add(jWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLoadWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel5Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel38)
                    .add(jXCountWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jPreviewWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 23, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel39)
                    .add(jYCountWorldObjectSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jTransparencyWorldObjectSprite))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        jLabel44.setText("Extension Points");

        jWorldObjectExtensions.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "XPos", "YPos"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane6.setViewportView(jWorldObjectExtensions);

        jAddWorldObjectExtension.setText("Add");
        jAddWorldObjectExtension.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddWorldObjectExtensionEvent(evt);
            }
        });

        jRemoveWorldObjectExtension.setText("Remove");
        jRemoveWorldObjectExtension.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireRemoveWorldObjectExtensionEvent(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jWorldObjectEditorLayout = new org.jdesktop.layout.GroupLayout(jWorldObjectEditor.getContentPane());
        jWorldObjectEditor.getContentPane().setLayout(jWorldObjectEditorLayout);
        jWorldObjectEditorLayout.setHorizontalGroup(
            jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jWorldObjectEditorLayout.createSequentialGroup()
                .addContainerGap()
                .add(jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jScrollPane5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE)
                    .add(jAddModifyWorldObject, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .add(jRemoveWorldObject, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 89, Short.MAX_VALUE))
                .add(jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(jWorldObjectEditorLayout.createSequentialGroup()
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jLabel44)
                        .add(32, 32, 32)
                        .add(jScrollPane6, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 435, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(jAddWorldObjectExtension, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .add(jRemoveWorldObjectExtension)))
                    .add(jWorldObjectEditorLayout.createSequentialGroup()
                        .add(4, 4, 4)
                        .add(jLabel36)
                        .add(79, 79, 79)
                        .add(jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                            .add(jWorldObjectName)
                            .add(jPanel5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))))
                .addContainerGap())
        );
        jWorldObjectEditorLayout.setVerticalGroup(
            jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jWorldObjectEditorLayout.createSequentialGroup()
                .addContainerGap()
                .add(jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jWorldObjectEditorLayout.createSequentialGroup()
                        .add(jScrollPane5, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 386, Short.MAX_VALUE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jAddModifyWorldObject)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jRemoveWorldObject))
                    .add(jWorldObjectEditorLayout.createSequentialGroup()
                        .add(jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel36)
                            .add(jWorldObjectName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jPanel5, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .add(18, 18, 18)
                        .add(jWorldObjectEditorLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jWorldObjectEditorLayout.createSequentialGroup()
                                .add(jAddWorldObjectExtension)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jRemoveWorldObjectExtension))
                            .add(jLabel44)
                            .add(jScrollPane6, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 118, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );

        jExtensionAddFrame.setTitle("Add Extension");

        jLabel47.setText("Enemy");

        jLabel48.setText("XPos");

        jExtensionXPos.setMaximumSize(new java.awt.Dimension(80, 20));
        jExtensionXPos.setMinimumSize(new java.awt.Dimension(80, 20));
        jExtensionXPos.setPreferredSize(new java.awt.Dimension(80, 20));

        jLabel49.setText("YPos");

        jExtensionYPos.setMaximumSize(new java.awt.Dimension(80, 20));
        jExtensionYPos.setMinimumSize(new java.awt.Dimension(80, 20));
        jExtensionYPos.setPreferredSize(new java.awt.Dimension(80, 20));

        jCloseExtensionFrame.setText("Close");
        jCloseExtensionFrame.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddWorldObjectExtensionEvent(evt);
            }
        });

        jAddExtension.setText("Add");
        jAddExtension.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddWorldObjectExtensionEvent(evt);
            }
        });

        org.jdesktop.layout.GroupLayout jExtensionAddFrameLayout = new org.jdesktop.layout.GroupLayout(jExtensionAddFrame.getContentPane());
        jExtensionAddFrame.getContentPane().setLayout(jExtensionAddFrameLayout);
        jExtensionAddFrameLayout.setHorizontalGroup(
            jExtensionAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jExtensionAddFrameLayout.createSequentialGroup()
                .addContainerGap()
                .add(jExtensionAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jExtensionAddFrameLayout.createSequentialGroup()
                        .add(jLabel47)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jEnemySelection, 0, 338, Short.MAX_VALUE))
                    .add(jExtensionAddFrameLayout.createSequentialGroup()
                        .add(jLabel48)
                        .add(18, 18, 18)
                        .add(jExtensionXPos, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                        .add(jLabel49)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jExtensionYPos, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                    .add(org.jdesktop.layout.GroupLayout.TRAILING, jExtensionAddFrameLayout.createSequentialGroup()
                        .add(jAddExtension)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jCloseExtensionFrame)))
                .addContainerGap())
        );
        jExtensionAddFrameLayout.setVerticalGroup(
            jExtensionAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jExtensionAddFrameLayout.createSequentialGroup()
                .addContainerGap()
                .add(jExtensionAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel47)
                    .add(jEnemySelection, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jExtensionAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel48)
                    .add(jExtensionXPos, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLabel49)
                    .add(jExtensionYPos, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jExtensionAddFrameLayout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jCloseExtensionFrame)
                    .add(jAddExtension))
                .addContainerGap(org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
        );

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setText("Name");

        jEnemiesList.addListSelectionListener(new javax.swing.event.ListSelectionListener() {
            public void valueChanged(javax.swing.event.ListSelectionEvent evt) {
                fireListSelectionChangedEvent(evt);
            }
        });
        jScrollPane1.setViewportView(jEnemiesList);

        jLabel5.setText("Health");

        jMaxHealth.setText("0");
        jMaxHealth.setMinimumSize(new java.awt.Dimension(100, 20));
        jMaxHealth.setPreferredSize(new java.awt.Dimension(100, 20));

        jLabel8.setText("Collision Damage");

        jCollisionDamage.setText("0");
        jCollisionDamage.setMinimumSize(new java.awt.Dimension(100, 20));
        jCollisionDamage.setPreferredSize(new java.awt.Dimension(100, 20));

        jLabel6.setText("Weapons");

        jAddWeapon.setText("Add");
        jAddWeapon.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddEnemyWeaponEvent(evt);
            }
        });

        jRemoveEnemyWeapon.setText("Remove");
        jRemoveEnemyWeapon.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireRemoveEnemyWeaponEvent(evt);
            }
        });

        jAddModifyEnemy.setText("Add/Modify");
        jAddModifyEnemy.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireAddModifyObjectEvent(evt);
            }
        });

        jRemoveEnemy.setText("Remove");
        jRemoveEnemy.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireRemoveObjectEvent(evt);
            }
        });

        jPanel1.setBorder(javax.swing.BorderFactory.createTitledBorder("View"));

        jLoadSprite.setText("Select");
        jLoadSprite.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireSelectSpriteEvent(evt);
            }
        });

        jLabel2.setText("Sprite");

        jLabel7.setText("XCount");

        jXCountSprite.setText("1");

        jLabel9.setText("YCount");

        jYCountSprite.setText("1");

        jSpriteTrans.setText("Transparency");
        jSpriteTrans.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jSpriteTrans.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jPreviewSprite.setText("Preview");
        jPreviewSprite.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireShowSpritePreviewEvent(evt);
            }
        });

        jLabel3.setText("Dest. Anim");

        jLoadDest.setText("Select");
        jLoadDest.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireSelectSpriteEvent(evt);
            }
        });

        jPreviewDest.setText("Preview");
        jPreviewDest.addMouseListener(new java.awt.event.MouseAdapter() {
            public void mouseClicked(java.awt.event.MouseEvent evt) {
                fireShowSpritePreviewEvent(evt);
            }
        });

        jLabel10.setText("XCount");

        jXCountDest.setText("1");

        jLabel11.setText("YCount");

        jYCountDest.setText("1");

        jDestTrans.setText("Transparency");
        jDestTrans.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jDestTrans.setMargin(new java.awt.Insets(0, 0, 0, 0));

        org.jdesktop.layout.GroupLayout jPanel1Layout = new org.jdesktop.layout.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jLabel10)
                    .add(jLabel2)
                    .add(jLabel7)
                    .add(jLabel3))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jSpritePath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 351, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jPanel1Layout.createSequentialGroup()
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jXCountSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jLabel9)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jYCountSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jSpriteTrans)))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(jLoadSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jPreviewSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 86, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)))
                    .add(jPanel1Layout.createSequentialGroup()
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jDestPath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 349, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(jPanel1Layout.createSequentialGroup()
                                .add(jXCountDest, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jLabel11)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jYCountDest, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 71, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.UNRELATED)
                                .add(jDestTrans)))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jPreviewDest, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 88, Short.MAX_VALUE)
                            .add(jLoadDest, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 87, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))))
                .addContainerGap())
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(jPanel1Layout.createSequentialGroup()
                .addContainerGap()
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel2)
                    .add(jSpritePath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jLoadSprite))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel7)
                    .add(jLabel9)
                    .add(jYCountSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jPreviewSprite)
                    .add(jXCountSprite, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jSpriteTrans))
                .add(36, 36, 36)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel3)
                    .add(jLoadDest)
                    .add(jDestPath, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(jPanel1Layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                    .add(jLabel10)
                    .add(jLabel11)
                    .add(jYCountDest, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jXCountDest, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                    .add(jDestTrans)
                    .add(jPreviewDest))
                .addContainerGap(16, Short.MAX_VALUE))
        );

        jWeaponsTable.setModel(new javax.swing.table.DefaultTableModel(
            new Object [][] {

            },
            new String [] {
                "Weapon", "DX", "DY", "Projectile"
            }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };

            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }

            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        jScrollPane2.setViewportView(jWeaponsTable);

        jLabel35.setText("Follow Player");

        jTrackPlayer.setBorder(javax.swing.BorderFactory.createEmptyBorder(0, 0, 0, 0));
        jTrackPlayer.setMargin(new java.awt.Insets(0, 0, 0, 0));

        jMenu1.setText("File");

        jMenuItem1.setText("Load Objects");
        jMenuItem1.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fireLoadObjectsEvent(evt);
            }
        });
        jMenu1.add(jMenuItem1);

        jMenuItem3.setText("Save");
        jMenuItem3.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fireSaveObjectsEvent(evt);
            }
        });
        jMenu1.add(jMenuItem3);
        jMenu1.add(jSeparator1);

        jMenuItem2.setText("Exit");
        jMenuItem2.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fireExitEvent(evt);
            }
        });
        jMenu1.add(jMenuItem2);

        jMenuBar1.add(jMenu1);

        jMenu2.setText("View");

        jShowWeaponEditor.setText("Weapon Editor");
        jShowWeaponEditor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fireShowEditorEvent(evt);
            }
        });
        jMenu2.add(jShowWeaponEditor);

        jShowProjectileEditor.setText("Projectile Editor");
        jShowProjectileEditor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fireShowEditorEvent(evt);
            }
        });
        jMenu2.add(jShowProjectileEditor);

        jShowWorldObjectEditor.setText("World Object Editor");
        jShowWorldObjectEditor.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                fireShowEditorEvent(evt);
            }
        });
        jMenu2.add(jShowWorldObjectEditor);

        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        org.jdesktop.layout.GroupLayout layout = new org.jdesktop.layout.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jRemoveEnemy, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jAddModifyEnemy, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE)
                    .add(org.jdesktop.layout.GroupLayout.LEADING, jScrollPane1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 143, Short.MAX_VALUE))
                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                    .add(layout.createSequentialGroup()
                        .add(jLabel1)
                        .add(57, 57, 57)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jName, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 531, Short.MAX_VALUE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jPanel1, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                    .add(layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(jLabel5)
                            .add(jLabel8)
                            .add(jLabel6)
                            .add(jLabel35))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jMaxHealth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jCollisionDamage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                            .add(layout.createSequentialGroup()
                                .add(jScrollPane2, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 408, Short.MAX_VALUE)
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING, false)
                                    .add(jRemoveEnemyWeapon, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                    .add(jAddWeapon, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, 117, Short.MAX_VALUE)))
                            .add(org.jdesktop.layout.GroupLayout.LEADING, jTrackPlayer))))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
            .add(layout.createSequentialGroup()
                .addContainerGap()
                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING, false)
                    .add(layout.createSequentialGroup()
                        .add(jScrollPane1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 494, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jAddModifyEnemy)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jRemoveEnemy))
                    .add(layout.createSequentialGroup()
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel1)
                            .add(jName, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(jPanel1, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE)
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel5)
                            .add(jMaxHealth, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .add(9, 9, 9)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jLabel8)
                            .add(jCollisionDamage, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, org.jdesktop.layout.GroupLayout.DEFAULT_SIZE, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.LEADING)
                            .add(layout.createSequentialGroup()
                                .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.TRAILING)
                                    .add(layout.createSequentialGroup()
                                        .add(jLabel6)
                                        .add(15, 15, 15))
                                    .add(layout.createSequentialGroup()
                                        .add(jAddWeapon)
                                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)))
                                .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                                .add(jRemoveEnemyWeapon))
                            .add(jScrollPane2, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE, 108, org.jdesktop.layout.GroupLayout.PREFERRED_SIZE))
                        .addPreferredGap(org.jdesktop.layout.LayoutStyle.RELATED)
                        .add(layout.createParallelGroup(org.jdesktop.layout.GroupLayout.BASELINE)
                            .add(jTrackPlayer)
                            .add(jLabel35))))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

private void fireRemoveWorldObjectExtensionEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireRemoveWorldObjectExtensionEvent
    int selection = jWorldObjectExtensions.getSelectedRow();
    if(selection < 0) return;
    ((DefaultTableModel)jWorldObjectExtensions.getModel()).removeRow(selection);
}//GEN-LAST:event_fireRemoveWorldObjectExtensionEvent
    
private void fireAddWorldObjectExtensionEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireAddWorldObjectExtensionEvent
    if(evt.getSource() == jAddWorldObjectExtension){
        Enumeration keys = enemies.keys();
        DefaultComboBoxModel model = new DefaultComboBoxModel();
        while(keys.hasMoreElements()){
            model.addElement(enemies.get(keys.nextElement()).getName());
        }
        
        jEnemySelection.setModel(model);
        jExtensionAddFrame.setVisible(true);
    }else  if(evt.getSource() == jAddExtension){
        boolean isError = false;
        jExtensionXPos.setBackground(Color.WHITE);
        jExtensionYPos.setBackground(Color.WHITE);
        String name = (String)jEnemySelection.getSelectedItem();
        if(name == null){
            isError = true;
        }
        int xPos = 0;
        int yPos = 0;
        try{
            xPos = Integer.parseInt(jExtensionXPos.getText());
        }catch(NumberFormatException nfe){
            jExtensionXPos.setBackground(Color.RED);
            isError = true;
        }
        
        try{
            yPos = Integer.parseInt(jExtensionYPos.getText());
        }catch(NumberFormatException nfe){
            jExtensionYPos.setBackground(Color.RED);
            isError = true;
        }
        
        if(isError) return;
        
        Object[] row = new Object[]{name, xPos, yPos};
        ((DefaultTableModel)jWorldObjectExtensions.getModel()).addRow(row);
    }else  if(evt.getSource() == jCloseExtensionFrame){
        jExtensionAddFrame.setVisible(false);
        
    }
}//GEN-LAST:event_fireAddWorldObjectExtensionEvent

private void fireFrameClosedEvent(java.awt.event.WindowEvent evt) {//GEN-FIRST:event_fireFrameClosedEvent
    if(evt.getSource() == jWeaponEditor){
        jShowWeaponEditor.setSelected(false);
    }else if(evt.getSource() == jProjectileEditor){
        jShowProjectileEditor.setSelected(false);
    }else if(evt.getSource() == jWorldObjectEditor){
        jShowWorldObjectEditor.setSelected(false);
    }
}//GEN-LAST:event_fireFrameClosedEvent

private void fireShowEditorEvent(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fireShowEditorEvent
    if(evt.getSource() == jShowWeaponEditor){
        jWeaponEditor.setVisible(jShowWeaponEditor.isSelected());
    }else if(evt.getSource() == jShowProjectileEditor){
        //build frame
        DefaultComboBoxModel model = new DefaultComboBoxModel();
        Enumeration<String> keys = projectiles.keys();
        while(keys.hasMoreElements()){
            model.addElement(projectiles.get(keys.nextElement()).getName());
        }
        
        jShrapnelProjectile.setModel(model);
        jProjectileEditor.setVisible(jShowProjectileEditor.isSelected());
    }else if(evt.getSource() == jShowWorldObjectEditor){
        jWorldObjectEditor.setVisible(jShowWorldObjectEditor.isSelected());
    }
}//GEN-LAST:event_fireShowEditorEvent

private void fireListSelectionChangedEvent(javax.swing.event.ListSelectionEvent evt) {//GEN-FIRST:event_fireListSelectionChangedEvent
    if(evt.getSource() == null) return;
    String selection = "";
    
    // <editor-fold defaultstate="collapsed" desc=" Enemy List Changed">
    if(evt.getSource() == jEnemiesList){
        selection = (String)jEnemiesList.getSelectedValue();
        if(selection == null) return;
        
        EnemyHelper helper = enemies.get(selection);
        if(helper == null) return;
        
        jName.setText(helper.getName());
        if(helper.getViewSprite() != null){
            jSpritePath.setText(helper.getViewSprite().getPath());
            jXCountSprite.setText(Integer.toString(helper.getViewSprite().getSpritesX()));
            jYCountSprite.setText(Integer.toString(helper.getViewSprite().getSpritesY()));
            jSpriteTrans.setSelected(helper.getViewSprite().isTransparencyUsed());
        }
        if(helper.getDestructionSprite() != null){
            jDestPath.setText(helper.getDestructionSprite().getPath());
            jXCountDest.setText(Integer.toString(helper.getDestructionSprite().getSpritesX()));
            jYCountDest.setText(Integer.toString(helper.getDestructionSprite().getSpritesY()));
            jDestTrans.setSelected(helper.getDestructionSprite().isTransparencyUsed());
        }
        jMaxHealth.setText(Integer.toString(helper.getMaxHealth()));
        jCollisionDamage.setText(Integer.toString(helper.getCollisionDamage()));
        jTrackPlayer.setSelected(helper.isIsTrackPlayer());
        
        jWeaponsTable.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
            
        },
                new String [] {
            "Weapon", "DX", "DY", "Projectile"
        }
        ) {
            Class[] types = new Class [] {
                java.lang.String.class, java.lang.Integer.class, java.lang.Integer.class, java.lang.String.class
            };
            boolean[] canEdit = new boolean [] {
                false, false, false, false
            };
            
            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
            
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        
        DefaultTableModel weaponModel = (DefaultTableModel)jWeaponsTable.getModel();
        for(EnemyWeaponHelper wh : helper.getWeapons()){
            Object[] row = new Object[]{wh.getWeapon().getName(), wh.getDx(), wh.getDy(), wh.getProjectile().getName()};
            weaponModel.addRow(row);
        }
        
        jWeaponsTable.revalidate();
        // </editor-fold>
        // <editor-fold defaultstate="collapsed" desc=" Weapon List Changed">
    }else if(evt.getSource() == jWeaponList){
        selection = (String)jWeaponList.getSelectedValue();
        
        if(selection == null) return;
        
        WeaponHelper helper = weapons.get(selection);
        jWeaponName.setText(helper.getName());
        jProjectileGroup.setSelectedItem(helper.getProjectileGroup());
        // </editor-fold>
        // <editor-fold defaultstate="collapsed" desc=" Projectile List Changed">
    }else if(evt.getSource() == jProjectileList){
        selection = (String)jProjectileList.getSelectedValue();
        
        if(selection == null) return;
        
        ProjectileHelper helper = projectiles.get(selection);
        jProjectileName.setText(helper.getName());
        jProjectileGroup.setSelectedItem(helper.getProjectileGroup());
        
        SpriteHelper sHelper = helper.getViewSprite();
        if(sHelper != null){
            jSpritePathProjectile.setText(sHelper.getPath());
            jXCountSpriteProjectile.setText(Integer.toString(sHelper.getSpritesX()));
            jYCountSpriteProjectile.setText(Integer.toString(sHelper.getSpritesY()));
            jSpriteTransProjectile.setSelected(sHelper.isTransparencyUsed());
        }
        
        sHelper = helper.getDestructionSprite();
        if(sHelper != null){
            jDestPathProjectile.setText(sHelper.getPath());
            jXCountDestProjectile.setText(Integer.toString(sHelper.getSpritesX()));
            jYCountDestProjectile.setText(Integer.toString(sHelper.getSpritesY()));
            jDestTransProjectile.setSelected(sHelper.isTransparencyUsed());
        }
        
        jProjectileDamage.setText(Integer.toString(helper.getDamage()));
        jShotsPerSecond.setText(Integer.toString(helper.getShotsPerSecond()));
        jProjectileStartSpeed.setText(Double.toString(helper.getStartSpeed()));
        jProjectileSpeedInc.setText(Double.toString(helper.getSpeedIncrement()));
        jProjectileMaxSpeed.setText(Double.toString(helper.getMaxSpeed()));
        
        WeaponBehaviorHelper bHelper = helper.getWeaponBehavior();
        if(bHelper != null){
            jProjectileBouncing.setSelected(bHelper.isBouncing());
            jProjectilePiercing.setSelected(bHelper.isPiercing());
            jProjectileTracking.setSelected(bHelper.isTracking());
            ShrapnelHelper shHelper = bHelper.getShrapnel();
            if(shHelper != null){
                jEnableShrapnel.setSelected(true);
                jShrapnelCount.setText(Integer.toString(shHelper.getCount()));
                jShrapnelDirection.setSelectedIndex(shHelper.getDirection());
                jShrapnelProjectile.setSelectedItem(shHelper.getShrapnelProjectile().getName());
            }else{
                jEnableShrapnel.setSelected(false);
            }
        }
    }// </editor-fold>
    // <editor-fold defaultstate="collapsed" desc=" World Object List Changed">
    else if(evt.getSource() == jWorldObjectList){
        selection = (String)jWorldObjectList.getSelectedValue();
        
        if(selection == null) return;
        
        WorldObjectHelper helper = worldObjects.get(selection);
        jWorldObjectName.setText(helper.getName());
        
        SpriteHelper sHelper = helper.getViewSprite();
        if(sHelper != null){
            jWorldObjectSprite.setText(sHelper.getPath());
            jXCountWorldObjectSprite.setText(Integer.toString(sHelper.getSpritesX()));
            jYCountWorldObjectSprite.setText(Integer.toString(sHelper.getSpritesY()));
            jTransparencyWorldObjectSprite.setSelected(sHelper.isTransparencyUsed());
        }
        
        jWorldObjectExtensions.setModel(new javax.swing.table.DefaultTableModel(
                new Object [][] {
            
        },
                new String [] {
             "XPos", "YPos"
        }
        ) {
            Class[] types = new Class [] {
                java.lang.Integer.class, java.lang.Integer.class
            };
            boolean[] canEdit = new boolean [] {
                false, false
            };
            
            public Class getColumnClass(int columnIndex) {
                return types [columnIndex];
            }
            
            public boolean isCellEditable(int rowIndex, int columnIndex) {
                return canEdit [columnIndex];
            }
        });
        
        DefaultTableModel model = (DefaultTableModel)jWorldObjectExtensions.getModel();
        
        for(ExtensionHelper eHelper : helper.getEnemyExtensions()){
            Object[] row = new Object[]{eHelper.getXPos(), eHelper.getYPos()};
            model.addRow(row);
        }
    }
    // </editor-fold>
    
}//GEN-LAST:event_fireListSelectionChangedEvent

private void fireRemoveEnemyWeaponEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireRemoveEnemyWeaponEvent
    int selection = jWeaponsTable.getSelectedRow();
    if(selection < 0) return;
    ((DefaultTableModel)jWeaponsTable.getModel()).removeRow(selection);
}//GEN-LAST:event_fireRemoveEnemyWeaponEvent

private void fireChangeWeaponEvent(java.awt.event.ItemEvent evt) {//GEN-FIRST:event_fireChangeWeaponEvent
    WeaponHelper helper = weapons.get(jWeaponSelection.getSelectedItem());
    if(helper == null) return;
    String group = helper.getProjectileGroup();
    Enumeration<String> projectileEnum = projectiles.keys();
    DefaultComboBoxModel projectileModel = new DefaultComboBoxModel();
    while(projectileEnum.hasMoreElements()){
        ProjectileHelper next = projectiles.get(projectileEnum.nextElement());
        if(next.getProjectileGroup().equals(group)){
            projectileModel.addElement(next.getName());
        }
    }
    jSupportedProjectiles.setModel(projectileModel);
    jSupportedProjectiles.setSelectedIndex(0);
}//GEN-LAST:event_fireChangeWeaponEvent

private void fireAddEnemyWeaponEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireAddEnemyWeaponEvent
    
    // <editor-fold defaultstate="collapsed" desc=" Show Add Weapon Dialog">
    if(evt.getSource() == jAddWeapon){
        Enumeration<String> weaponsEnum = weapons.keys();
        DefaultComboBoxModel weaponModel = new DefaultComboBoxModel();
        while(weaponsEnum.hasMoreElements()){
            weaponModel.addElement(weaponsEnum.nextElement());
        }
        
        jWeaponSelection.setModel(weaponModel);
        jWeaponSelection.setSelectedIndex(0);
        fireChangeWeaponEvent(null);
        
        if(!jWeaponAddFrame.isVisible()){
            jWeaponAddFrame.setVisible(true);
        }
        // </editor-fold>
        // <editor-fold defaultstate="collapsed" desc=" Add Weapon ">
    }else if(evt.getSource() == jDoAddWeapon){
        boolean isError = false;
        jWeaponDX.setBackground(Color.WHITE);
        jWeaponDY.setBackground(Color.WHITE);
        
        //check dx
        int dx = 0;
        try{
            dx = Integer.parseInt(jWeaponDX.getText());
        }catch(NumberFormatException nfe){
            jWeaponDX.setBackground(Color.RED);
            isError = true;
        }
        
        //check dy
        int dy = 0;
        try{
            dy = Integer.parseInt(jWeaponDY.getText());
        }catch(NumberFormatException nfe){
            jWeaponDY.setBackground(Color.RED);
            isError = true;
        }
        if(isError) return;
        String weapon = (String)jWeaponSelection.getSelectedItem();
        String projectile = (String)jSupportedProjectiles.getSelectedItem();
        Object[] row = new Object[]{weapon, dx, dy, projectile};
        
        ((DefaultTableModel)jWeaponsTable.getModel()).addRow(row);
        // </editor-fold>
        // <editor-fold defaultstate="collapsed" desc=" Close Add Weapon Dialog ">
    }else if(evt.getSource() == jCloseAddEnemyFrame){
        jWeaponAddFrame.setVisible(false);
    }
    // </editor-fold>
}//GEN-LAST:event_fireAddEnemyWeaponEvent

private void fireRemoveObjectEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireRemoveObjectEvent
    
    JList current = null;
    String type = null;
    String val = null;
    
    // <editor-fold defaultstate="collapsed" desc=" Remove Weapon ">
    if(evt.getSource() == jEditorRemoveWeapon){
        //remove/modify weapon
        current = jWeaponList;
        type = "weapon";
        val = (String)current.getSelectedValue();
        if(val == null) return;
        List<String> dependencies = getWeaponDependencies(val);
        
        if(dependencies.size() > 0){
            String message = "There are objects depending on weapon \"" + val + "\":\n";
            for(String dependency : dependencies){
                message += "  " + dependency + "\n";
            }
            message += "Remove dependencies first.";
            JOptionPane.showMessageDialog(jWeaponEditor, message, "Dependency Warning", JOptionPane.WARNING_MESSAGE);
            return;
        }
        // </editor-fold>
        // <editor-fold defaultstate="collapsed" desc=" Remove Projectile ">
    }else if(evt.getSource() == jRemoveProjectile){
        //remove/modify projectile
        current = jProjectileList;
        type = "projectile";
        val = (String)current.getSelectedValue();
        if(val == null) return;
        
        List<String> dependencies = getProjectileDependencies(val);
        if(dependencies.size() > 0){
            String message = "There are objects depending on projectile \"" + val + "\":\n";
            for(String dependency : dependencies){
                message += "  " + dependency + "\n";
            }
            message += "Remove dependencies first.";
            JOptionPane.showMessageDialog(jProjectileEditor, message, "Dependency Warning", JOptionPane.WARNING_MESSAGE);
            return;
        }
        // </editor-fold>
        // <editor-fold defaultstate="collapsed" desc=" Remove Enemy ">
    }else if(evt.getSource() == jRemoveEnemy){
        //remove/modify enemy
        current = jEnemiesList;
        type = "enemy";
        val = (String)current.getSelectedValue();
        if(val == null) return;
    }// </editor-fold>
    // <editor-fold defaultstate="collapsed" desc=" Remove World Object ">
    else if(evt.getSource() == jRemoveWorldObject){
        //remove/modify world object
        current = jWorldObjectList;
        type = "world object";
        val = (String)current.getSelectedValue();
        if(val == null) return;
    }
    // </editor-fold>
    
    int ret = JOptionPane.showConfirmDialog(current, "Remove " + type  + " " +  val + "?", "Remove", JOptionPane.YES_NO_OPTION);
    
    if(ret == JOptionPane.YES_OPTION){
        ((DefaultListModel)current.getModel()).removeElement(val);
        if(evt.getSource() == jRemoveEnemyWeapon){
            weapons.remove(val);
        }else if(evt.getSource() == jRemoveProjectile){
            projectiles.remove(val);
        }else if(evt.getSource() == jRemoveEnemy){
            enemies.remove(val);
            updateEnemyList();
        }
    }
}//GEN-LAST:event_fireRemoveObjectEvent

private List<String> getWeaponDependencies(String weaponName){
    List<String> dependencies = new LinkedList();
    Enumeration<String> keys = enemies.keys();
    while(keys.hasMoreElements()){
        EnemyHelper enemy = enemies.get(keys.nextElement());
        for(EnemyWeaponHelper helper : enemy.getWeapons()){
            if(helper.getWeapon().getName().equals(weaponName)){
                dependencies.add(enemy.getName() + "(Enemy)");
            }
        }
    }
    return dependencies;
}

private List<String> getProjectileDependencies(String projectileName){
    List<String> dependencies = new LinkedList();
    Enumeration<String> keys = enemies.keys();
    while(keys.hasMoreElements()){
        EnemyHelper enemy = enemies.get(keys.nextElement());
        for(EnemyWeaponHelper helper : enemy.getWeapons()){
            if(helper.getProjectile().getName().equals(projectileName)){
                dependencies.add(enemy.getName() + "(Enemy)");
            }
        }
    }
    return dependencies;
}

private List<String> getProjectileGroupDependencies(String groupName){
    List<String> dependencies = new LinkedList();
    Enumeration<String> keys = weapons.keys();
    while(keys.hasMoreElements()){
        WeaponHelper weapon = weapons.get(keys.nextElement());
        if(weapon.getProjectileGroup().equals(groupName)){
            dependencies.add(weapon.getName() + "(Weapon)");
        }
    }
    
    keys = projectiles.keys();
    while(keys.hasMoreElements()){
        ProjectileHelper projectile = projectiles.get(keys.nextElement());
        if(projectile.getProjectileGroup().equals(groupName)){
            dependencies.add(projectile.getName() + "(Projetile)");
        }
    }
    return dependencies;
}

    private void fireAddModifyObjectEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireAddModifyObjectEvent
        
        boolean isError = false;
        
        // <editor-fold defaultstate="collapsed" desc=" Add/Modify Projectile ">
        if(evt.getSource() == jAddModifyProjectile){
            //add/modify projectile
            ProjectileHelper helper = new ProjectileHelper();
            boolean useShrapnel = jEnableShrapnel.isSelected();
            
            jProjectileName.setBackground(Color.WHITE);
            jProjectileGroup.setBackground(Color.WHITE);
            jProjectileDamage.setBackground(Color.WHITE);
            jProjectileStartSpeed.setBackground(Color.WHITE);
            jProjectileSpeedInc.setBackground(Color.WHITE);
            jProjectileMaxSpeed.setBackground(Color.WHITE);
            jSpritePathProjectile.setBackground(Color.WHITE);
            jDestPathProjectile.setBackground(Color.WHITE);
            jXCountSpriteProjectile.setBackground(Color.WHITE);
            jYCountSpriteProjectile.setBackground(Color.WHITE);
            jXCountDestProjectile.setBackground(Color.WHITE);
            jYCountDestProjectile.setBackground(Color.WHITE);
            jShrapnelCount.setBackground(Color.WHITE);
            jShrapnelProjectile.setBackground(Color.WHITE);
            jFanDegree.setBackground(Color.WHITE);
            
            String name = jProjectileName.getText();
            if(name.length() < 1){
                jProjectileName.setBackground(Color.RED);
                isError = true;
            }
            
            if(jProjectileGroup.getSelectedIndex() < 0){
                jProjectileGroup.setBackground(Color.RED);
                isError = true;
            }
            int proDmg = 0;
            try{
                proDmg = Integer.parseInt(jProjectileDamage.getText());
            }catch(NumberFormatException nfe){
                jProjectileDamage.setBackground(Color.RED);
                isError = true;
            }
            
            int sps = 0;
            try{
                sps = Integer.parseInt(jShotsPerSecond.getText());
            }catch(NumberFormatException nfe){
                jShotsPerSecond.setBackground(Color.RED);
                isError = true;
            }
            
            //speeds
            double minSpeed = 0;
            double speedInc = 0;
            double maxSpeed = 0;
            
            try{
                minSpeed = Double.parseDouble(jProjectileStartSpeed.getText());
            }catch(NumberFormatException nfe){
                jProjectileStartSpeed.setBackground(Color.RED);
                isError = true;
            }
            
            try{
                speedInc = Double.parseDouble(jProjectileSpeedInc.getText());
            }catch(NumberFormatException nfe){
                jProjectileSpeedInc.setBackground(Color.RED);
                isError = true;
            }
            
            try{
                maxSpeed = Double.parseDouble(jProjectileMaxSpeed.getText());
            }catch(NumberFormatException nfe){
                jProjectileMaxSpeed.setBackground(Color.RED);
                isError = true;
            }
            
            //projectile sprite fields
            String proSprite = jSpritePathProjectile.getText();
            
            if((proSprite.length() < 1)||(!new File(proSprite).exists())){
                jSpritePathProjectile.setBackground(Color.RED);
                isError = true;
            }else{
                try{
                    ImageIO.read(new File(proSprite));
                }catch(Exception e){
                    jSpritePathProjectile.setBackground(Color.RED);
                    isError = true;
                }
            }
            
            int proSpriteX = 0;
            try{
                proSpriteX = Integer.parseInt(jXCountSpriteProjectile.getText());
                if(proSpriteX <= 0) throw new NumberFormatException();
            }catch(NumberFormatException nfe){
                jXCountSpriteProjectile.setBackground(Color.RED);
                isError = true;
            }
            
            int proSpriteY = 0;
            try{
                proSpriteY = Integer.parseInt(jYCountSpriteProjectile.getText());
                if(proSpriteY <= 0) throw new NumberFormatException();
            }catch(NumberFormatException nfe){
                jYCountSpriteProjectile.setBackground(Color.RED);
                isError = true;
            }
            
            //projectile destruction sprite fields
            String proDestSprite = jDestPathProjectile.getText();
            boolean useDestSprite = true;
            if(proDestSprite.length() < 1){
                useDestSprite = false;
            }
            
            int proDestSpriteX = 0;
            int proDestSpriteY = 0;
            //only check if dest sprite used
            if(useDestSprite){
                if(!new File(proDestSprite).exists()){
                    jDestPathProjectile.setBackground(Color.RED);
                    isError = true;
                }else{
                    try{
                        ImageIO.read(new File(proSprite));
                    }catch(Exception e){
                        jDestPathProjectile.setBackground(Color.RED);
                        isError = false;
                    }
                }
                
                try{
                    proDestSpriteX = Integer.parseInt(jXCountDestProjectile.getText());
                    if(proDestSpriteX <= 0) throw new NumberFormatException();
                }catch(NumberFormatException nfe){
                    jXCountDestProjectile.setBackground(Color.RED);
                    isError = true;
                }
                
                try{
                    proDestSpriteY = Integer.parseInt(jYCountDestProjectile.getText());
                    if(proDestSpriteY <= 0) throw new NumberFormatException();
                }catch(NumberFormatException nfe){
                    jYCountDestProjectile.setBackground(Color.RED);
                    isError = true;
                }
            }
            
            int shrapCount = 0;
            double fanDeg = 0;
            int shrapSpriteX = 0;
            int shrapSpriteY = 0;
            
            String shrapProjectile = (String)jShrapnelProjectile.getSelectedItem();
            
            //only check if shrapnel is enabled
            if(useShrapnel){
                try{
                    shrapCount = Integer.parseInt(jShrapnelCount.getText());
                    if(shrapCount <= 0) throw new NumberFormatException();
                }catch(NumberFormatException nfe){
                    jShrapnelCount.setBackground(Color.RED);
                    isError = true;
                }
                
                if(jShrapnelDirection.getSelectedIndex() == ShrapnelHelper.FAN_DIRECTION){
                    try{
                        fanDeg = Double.parseDouble(jFanDegree.getText());
                    }catch(NumberFormatException nfe){
                        jFanDegree.setBackground(Color.RED);
                        isError = true;
                    }
                }
                
                if(shrapProjectile == null){
                    jShrapnelProjectile.setBackground(Color.RED);
                    isError = true;
                }
            }
            
            if(isError) return;
            
            //update existing object or insert new one
            if(projectiles.containsKey(name)){
                helper = projectiles.get(name);
            }else{
                helper.setName(name);
                projectiles.put(name, helper);
            }
            
            helper.setProjectileGroup((String)jProjectileGroup.getSelectedItem());
            
            SpriteHelper projSprite  = new SpriteHelper();
            projSprite.setPath(proSprite);
            projSprite.setSpritesX(proSpriteX);
            projSprite.setSpritesY(proSpriteY);
            projSprite.setTransparencyUsed(jSpriteTransProjectile.isSelected());
            helper.setViewSprite(projSprite);
            if(useDestSprite){
                SpriteHelper destSprite  = new SpriteHelper();
                destSprite.setPath(proDestSprite);
                destSprite.setSpritesX(proDestSpriteX);
                destSprite.setSpritesY(proDestSpriteY);
                destSprite.setTransparencyUsed(jDestTransProjectile.isSelected());
                helper.setDestructionSprite(destSprite);
            }
            
            helper.setDamage(proDmg);
            helper.setShotsPerSecond(sps);
            helper.setStartSpeed(minSpeed);
            helper.setSpeedIncrement(speedInc);
            helper.setMaxSpeed(maxSpeed);
            
            WeaponBehaviorHelper wbHelper = new WeaponBehaviorHelper();
            wbHelper.setBouncing(jProjectileBouncing.isSelected());
            wbHelper.setPiercing(jProjectilePiercing.isSelected());
            wbHelper.setTracking(jProjectileTracking.isSelected());
            
            if(useShrapnel){
                ShrapnelHelper sHelper = new ShrapnelHelper();
                sHelper.setShrapnelProjectile(projectiles.get(shrapProjectile));
                sHelper.setDirection(jShrapnelDirection.getSelectedIndex());
                
                if(sHelper.getDirection() == sHelper.FAN_DIRECTION){
                    sHelper.setFanDegree(fanDeg);
                }
                
                sHelper.setCount(shrapCount);
                
                wbHelper.setShrapnel(sHelper);
            }
            
            helper.setWeaponBehavior(wbHelper);
            jProjectileList.setSelectedIndex(-1);
            // </editor-fold>
            // <editor-fold defaultstate="collapsed" desc=" Add/Modify Weapon ">
        }else if(evt.getSource() == jAddModifyWeapon){
            //add/modify weapon
            WeaponHelper helper = new WeaponHelper();
            
            jWeaponName.setBackground(Color.WHITE);
            jProjectileGroupSelectionWeapon.setBackground(Color.WHITE);
            String name = jWeaponName.getText();
            
            if(name.length() < 1){
                jWeaponName.setBackground(Color.RED);
                isError = true;
            }
            
            if(jProjectileGroupSelectionWeapon.getSelectedIndex() < 0){
                jProjectileGroupSelectionWeapon.setBackground(Color.RED);
                isError = true;
            }
            
            if(isError) return;
            
            
            //update existing object or insert new one
            if(weapons.containsKey(name)){
                helper = weapons.get(name);
            }else{
                helper.setName(name);
                weapons.put(name, helper);
            }
            
            //set values and store weapon
            helper.setName(name);
            helper.setProjectileGroup((String)jProjectileGroupSelectionWeapon.getSelectedItem());
            
            weapons.put(name, helper);
            jWeaponList.setSelectedIndex(-1);
            // </editor-fold>
            // <editor-fold defaultstate="collapsed" desc=" Add/Modify Enemy ">
        }else if(evt.getSource() == jAddModifyEnemy){
            //add/modify enemy
            EnemyHelper helper = new EnemyHelper();
            
            jSpritePath.setBackground(Color.WHITE);
            jDestPath.setBackground(Color.WHITE);
            jMaxHealth.setBackground(Color.WHITE);
            jCollisionDamage.setBackground(Color.WHITE);
            
            //check important fields
            if(jName.getText().length() < 1){
                jName.setBackground(Color.RED);
                isError = true;
            }
            
            //check if sprite exist
            String spritePath = jSpritePath.getText();
            int spriteXCount = 0;
            int spriteYCount = 0;
            
            if((spritePath.length() < 1) || (!new File(spritePath).exists())){
                jSpritePath.setBackground(Color.RED);
                isError = true;
            }else{
                try{
                    ImageIO.read(new File(spritePath));
                }catch(Exception e){
                    jSpritePath.setBackground(Color.RED);
                    isError = false;
                }
            }
            
            try{
                spriteXCount = Integer.parseInt(jXCountSprite.getText());
                if(spriteXCount <= 0) throw new NumberFormatException();
            }catch(NumberFormatException nfe){
                jXCountSprite.setBackground(Color.RED);
                isError = true;
            }
            
            try{
                spriteYCount = Integer.parseInt(jYCountSprite.getText());
                if(spriteYCount <= 0) throw new NumberFormatException();
            }catch(NumberFormatException nfe){
                jYCountSprite.setBackground(Color.RED);
                isError = true;
            }
            
            
            //check if destruction sprite exists (only if sth. selected)
            String destSprite = jDestPath.getText();
            int destXCount = 0;
            int destYCount = 0;
            
            boolean useDestSprite = true;
            if(destSprite.length() < 1){
                useDestSprite = false;
            }
            
            if(useDestSprite){
                if(!new File(destSprite).exists()){
                    jDestPath.setBackground(Color.RED);
                    isError = true;
                }else{
                    try{
                        ImageIO.read(new File(destSprite));
                    }catch(Exception e){
                        jDestPath.setBackground(Color.RED);
                        isError = false;
                    }
                }
                
                try{
                    destXCount = Integer.parseInt(jXCountDest.getText());
                }catch(NumberFormatException nfe){
                    jXCountDest.setBackground(Color.RED);
                    isError = true;
                }
                
                try{
                    destYCount = Integer.parseInt(jYCountDest.getText());
                }catch(NumberFormatException nfe){
                    jYCountDest.setBackground(Color.RED);
                    isError = true;
                }
            }
            
            int maxHealth = 0;
            int collisionDamage = 0;
            
            try{
                maxHealth = Integer.parseInt(jMaxHealth.getText());
            }catch(NumberFormatException nfe){
                jMaxHealth.setBackground(Color.RED);
                isError = true;
            }
            
            try{
                collisionDamage = Integer.parseInt(jCollisionDamage.getText());
            }catch(NumberFormatException nfe){
                jCollisionDamage.setBackground(Color.RED);
                isError = true;
            }
            
            if(isError) return;
            
            //update existing object or insert new one
            if(enemies.containsKey(jName.getText())){
                helper = enemies.get(jName.getText());
            }else{
                helper.setName(jName.getText());
                enemies.put(jName.getText(), helper);
            }
            
            //set values
            SpriteHelper sHelper = new SpriteHelper();
            sHelper.setPath(spritePath);
            sHelper.setSpritesX(spriteXCount);
            sHelper.setSpritesY(spriteYCount);
            sHelper.setTransparencyUsed(jSpriteTrans.isSelected());
            helper.setViewSprite(sHelper);
            
            if(useDestSprite){
                SpriteHelper destHelper = new SpriteHelper();
                destHelper.setPath(destSprite);
                destHelper.setSpritesX(destXCount);
                destHelper.setSpritesY(destYCount);
                destHelper.setTransparencyUsed(jDestTrans.isSelected());
                helper.setDestructionSprite(destHelper);
            }
            
            helper.setMaxHealth(maxHealth);
            helper.setCollisionDamage(collisionDamage);
            helper.setIsTrackPlayer(jTrackPlayer.isSelected());
            helper.clearWeapons();
            
            for(int i=0;i<jWeaponsTable.getModel().getRowCount();i++){
                EnemyWeaponHelper wHelper = new EnemyWeaponHelper();
                String weapon = (String)jWeaponsTable.getModel().getValueAt(i, WEAPON_COL);
                int dx = (Integer)jWeaponsTable.getModel().getValueAt(i, DX_COL);
                int dy = (Integer)jWeaponsTable.getModel().getValueAt(i, DY_COL);
                String projectile = (String)jWeaponsTable.getModel().getValueAt(i, PROJECTILE_COL);
                wHelper.setWeapon(weapons.get(weapon));
                wHelper.setDx(dx);
                wHelper.setDy(dy);
                wHelper.setProjectile(projectiles.get(projectile));
                helper.addWeapon(wHelper);
            }
            
            updateEnemyList();
            jEnemiesList.setSelectedIndex(-1);
            // </editor-fold>
            // <editor-fold defaultstate="collapsed" desc=" Add/Modify World Object ">
        }else if(evt.getSource() == jAddModifyWorldObject){
            //add/modify enemy
            WorldObjectHelper helper = new WorldObjectHelper();
            
            jWorldObjectSprite.setBackground(Color.WHITE);

            //check important fields
            if(jWorldObjectName.getText().length() < 1){
                jWorldObjectName.setBackground(Color.RED);
                isError = true;
            }
            
            //check if sprite exist
            String spritePath = jWorldObjectSprite.getText();
            int spriteXCount = 0;
            int spriteYCount = 0;
            
            if((spritePath.length() < 1) || (!new File(spritePath).exists())){
                jWorldObjectSprite.setBackground(Color.RED);
                isError = true;
            }else{
                try{
                    ImageIO.read(new File(spritePath));
                }catch(Exception e){
                    jWorldObjectSprite.setBackground(Color.RED);
                    isError = false;
                }
            }
            
            try{
                spriteXCount = Integer.parseInt(jXCountWorldObjectSprite.getText());
                if(spriteXCount <= 0) throw new NumberFormatException();
            }catch(NumberFormatException nfe){
                jXCountWorldObjectSprite.setBackground(Color.RED);
                isError = true;
            }
            
            try{
                spriteYCount = Integer.parseInt(jYCountWorldObjectSprite.getText());
                if(spriteYCount <= 0) throw new NumberFormatException();
            }catch(NumberFormatException nfe){
                jYCountWorldObjectSprite.setBackground(Color.RED);
                isError = true;
            }

            if(isError) return;
            
            //update existing object or insert new one
            if(worldObjects.containsKey(jWorldObjectName.getText())){
                helper = worldObjects.get(jName.getText());
            }else{
                helper.setName(jWorldObjectName.getText());
                worldObjects.put(jWorldObjectName.getText(), helper);
            }
            
            //set values
            SpriteHelper sHelper = new SpriteHelper();
            sHelper.setPath(spritePath);
            sHelper.setSpritesX(spriteXCount);
            sHelper.setSpritesY(spriteYCount);
            sHelper.setTransparencyUsed(jSpriteTrans.isSelected());
            helper.setViewSprite(sHelper);
            
            helper.clearExtensions();
            
            for(int i=0;i<jWeaponsTable.getModel().getRowCount();i++){
                ExtensionHelper eHelper = new ExtensionHelper();
                int xPos = (Integer)jWorldObjectExtensions.getModel().getValueAt(i, XPOS_COL);
                int yPos = (Integer)jWorldObjectExtensions.getModel().getValueAt(i, YPOS_COL);
                eHelper.setXPos(xPos);
                eHelper.setYPos(yPos);
                helper.addEnemyExtension(eHelper);
            }
            
            updateEnemyList();
            jEnemiesList.setSelectedIndex(-1);
        }
        // </editor-fold>
}//GEN-LAST:event_fireAddModifyObjectEvent
    
private void fireModifyProjectileGroupEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireModifyProjectileGroupEvent
    if(evt.getSource() == jAddProjectileGroup){
        //add group
        String pGroup = jProjectileGroupName.getText();
        if(pGroup.length() < 1) return;
        mProjectileGroupsModel.insertElementAt(pGroup, 0);
    }else{
        //remove group
        String selection = (String)mProjectileGroupsModel.getSelectedItem();
        if(selection == null) return;
        
        List<String> dependencies = getProjectileGroupDependencies(selection);
        if(dependencies.size() > 0){
            if(dependencies.size() > 0){
                String message = "There are objects depending on group \"" + selection + "\":\n";
                for(String dependency : dependencies){
                    message += "  " + dependency + "\n";
                }
                message += "Remove dependencies first.";
                JOptionPane.showMessageDialog(jWeaponEditor, message, "Dependency Warning", JOptionPane.WARNING_MESSAGE);
                return;
            }
        }
        mProjectileGroupsModel.removeElement(selection);
    }
}//GEN-LAST:event_fireModifyProjectileGroupEvent

private void jLoadDestProjectilefireSelectSpriteEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLoadDestProjectilefireSelectSpriteEvent
    // TODO add your handling code here:
}//GEN-LAST:event_jLoadDestProjectilefireSelectSpriteEvent

private void jLoadSpriteProjectilefireSelectSpriteEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_jLoadSpriteProjectilefireSelectSpriteEvent
    // TODO add your handling code here:
}//GEN-LAST:event_jLoadSpriteProjectilefireSelectSpriteEvent

private void fireUpdatePreviewEvent(javax.swing.event.ChangeEvent evt) {//GEN-FIRST:event_fireUpdatePreviewEvent
    updatePreview();
}//GEN-LAST:event_fireUpdatePreviewEvent

private void fireShowSpritePreviewEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireShowSpritePreviewEvent
    try{
        mPreviewW = 1;
        mPreviewH = 1;
        
        if(evt.getSource() == jPreviewSprite){
            mCurrentPreview = ImageIO.read(new File(jSpritePath.getText()));
            mPreviewXCount = Integer.parseInt(jXCountSprite.getText());
            mPreviewYCount = Integer.parseInt(jYCountSprite.getText());
            mPreviewW = mCurrentPreview.getWidth() / mPreviewXCount;
            mPreviewH = mCurrentPreview.getHeight() / mPreviewYCount;
        }else if(evt.getSource() == jPreviewDest){
            mCurrentPreview = ImageIO.read(new File(jDestPath.getText()));
            mPreviewXCount = Integer.parseInt(jXCountDest.getText());
            mPreviewYCount = Integer.parseInt(jYCountDest.getText());
            mPreviewW = mCurrentPreview.getWidth() / mPreviewXCount;
            mPreviewH = mCurrentPreview.getHeight() / mPreviewYCount;
        }else if(evt.getSource() == jPreviewSpriteProjectile){
            mCurrentPreview = ImageIO.read(new File(jSpritePathProjectile.getText()));
            mPreviewXCount = Integer.parseInt(jXCountSpriteProjectile.getText());
            mPreviewYCount = Integer.parseInt(jYCountSpriteProjectile.getText());
            mPreviewW = mCurrentPreview.getWidth() / mPreviewXCount;
            mPreviewH = mCurrentPreview.getHeight() / mPreviewYCount;
        }else if(evt.getSource() == jPreviewDestProjectile){
            mCurrentPreview = ImageIO.read(new File(jDestPathProjectile.getText()));
            mPreviewXCount = Integer.parseInt(jXCountDestProjectile.getText());
            mPreviewYCount = Integer.parseInt(jYCountDestProjectile.getText());
            mPreviewW = mCurrentPreview.getWidth() / mPreviewXCount;
            mPreviewH = mCurrentPreview.getHeight() / mPreviewYCount;
        }else if(evt.getSource() == jPreviewWorldObjectSprite){
            mCurrentPreview = ImageIO.read(new File(jWorldObjectSprite.getText()));
            mPreviewXCount = Integer.parseInt(jXCountWorldObjectSprite.getText());
            mPreviewYCount = Integer.parseInt(jYCountWorldObjectSprite.getText());
            mPreviewW = mCurrentPreview.getWidth() / mPreviewXCount;
            mPreviewH = mCurrentPreview.getHeight() / mPreviewYCount;
        }
        
        jPreviewSlider.setMinimum(1);
        jPreviewSlider.setMaximum(mPreviewXCount * mPreviewYCount);
        jPreviewSlider.setValue(1);
        updatePreview();
        
        jPreviewFrame.pack();
        jPreviewFrame.setVisible(true);
    }catch(Exception e){
        JOptionPane.showMessageDialog(this, "Problems while opening preview. (" + e + ")", "Error", JOptionPane.ERROR_MESSAGE);
    }
}//GEN-LAST:event_fireShowSpritePreviewEvent

private void updatePreview(){
    int v = jPreviewSlider.getValue();
    //N:\JavaProjects\SpaceTiger\src\de\tor\resources\asteroid1.png
    int iy = v/mPreviewXCount;
    int ix = v%mPreviewXCount;
    
    if(ix == 0){
        ix = mPreviewXCount-1;
        iy = 0;
    }
    jPreviewLabel.setIcon(new ImageIcon(mCurrentPreview.getSubimage(ix*mPreviewW,iy*mPreviewH,mPreviewW,mPreviewH)));
    jPreviewFrame.repaint();
}

    private void fireSelectSpriteEvent(java.awt.event.MouseEvent evt) {//GEN-FIRST:event_fireSelectSpriteEvent
        JFileChooser load = null;
        //switch possible sources
        if(evt.getSource() == jLoadSprite){
            load = new JFileChooser(new File(jSpritePath.getText()).getParent());
        }else if(evt.getSource() == jLoadDest){
            load = new JFileChooser(new File(jDestPath.getText()).getParent());
        }else if(evt.getSource() == jLoadSpriteProjectile){
            load = new JFileChooser(new File(jSpritePathProjectile.getText()).getParent());
        }else if(evt.getSource() == jLoadDestProjectile){
            load = new JFileChooser(new File(jDestPathProjectile.getText()).getParent());
        }else if(evt.getSource() == jLoadWorldObjectSprite){
            load = new JFileChooser(new File(jWorldObjectSprite.getText()).getParent());
        }
        
        //if load still null initialize and open
        if(load == null) load = new JFileChooser();
        int retVal = load.showOpenDialog(this);
        
        //check "OK" selection and set result
        if(retVal == load.APPROVE_OPTION){
            if(evt.getSource() == jLoadSprite){
                jSpritePath.setText(load.getSelectedFile().getPath());
            }else if(evt.getSource() == jLoadDest){
                jDestPath.setText(load.getSelectedFile().getPath());
            }else if(evt.getSource() == jLoadSpriteProjectile){
                jSpritePathProjectile.setText(load.getSelectedFile().getPath());
            }else if(evt.getSource() == jLoadDestProjectile){
                jDestPathProjectile.setText(load.getSelectedFile().getPath());
            }else if(evt.getSource() == jLoadWorldObjectSprite){
                jWorldObjectSprite.setText(load.getSelectedFile().getPath());
            }
        }
}//GEN-LAST:event_fireSelectSpriteEvent
    
    private void fireExitEvent(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fireExitEvent
        System.exit(0);
    }//GEN-LAST:event_fireExitEvent
    
    private void fireSaveObjectsEvent(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fireSaveObjectsEvent
        if(mObjPath == null){
            JFileChooser saveAs = new JFileChooser();
            saveAs.setDialogTitle("Save object settings under directory");
            saveAs.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
            int retVal = saveAs.showSaveDialog(this);
            if(retVal == saveAs.APPROVE_OPTION){
                if(saveAs.getSelectedFile() == null) return;
                try{
                    mObjPath = saveAs.getSelectedFile().getCanonicalPath();
                }catch(Exception e){}
                saveObjects();
            }else{
                return;
            }
        }
        saveObjects();
    }//GEN-LAST:event_fireSaveObjectsEvent
    
    private void fireLoadObjectsEvent(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_fireLoadObjectsEvent
        JFileChooser load = null;
        if(mObjPath != null){
            load = new JFileChooser(mObjPath );
        }else{
            load = new JFileChooser();
        }
        
        load.setDialogTitle("Load object settings from directory");
        load.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY);
        int retVal = load.showOpenDialog(this);
        if(retVal == load.APPROVE_OPTION){
            try{
                mObjPath = load.getSelectedFile().getCanonicalPath();
            }catch(Exception e){}
            loadObjects();
        }
    }//GEN-LAST:event_fireLoadObjectsEvent
    
    private void saveObjects(){
        try{
            //write objects
            String file = mObjPath + "/" + OBJECTS_FILE;
            ObjectOutputStream oout = new ObjectOutputStream(new FileOutputStream(new File(file)));
            oout.writeObject(enemies);
            oout.close();
            //write weapons
            file = mObjPath + "/" + WEAPONS_FILE;
            oout = new ObjectOutputStream(new FileOutputStream(new File(file)));
            oout.writeObject(weapons);
            oout.close();
        }catch(Exception e){
            e.printStackTrace();
        }
    }
    
    private void loadObjects(){
        try{
            //read objects
            String file = mObjPath + "/" + OBJECTS_FILE;
            ObjectInputStream oin = new ObjectInputStream(new FileInputStream(new File(file)));
            enemies = (Hashtable<String,EnemyHelper>)oin.readObject();
            oin.close();
            //read weapons
            file = mObjPath + "/" + WEAPONS_FILE;
            oin = new ObjectInputStream(new FileInputStream(new File(file)));
            weapons = (Hashtable<String, WeaponHelper>)oin.readObject();
            oin.close();
        }catch(Exception e){
            JOptionPane.showMessageDialog(this, mObjPath  + " does not seem to be a valid data directory.", "Error", JOptionPane.ERROR_MESSAGE);
        }
        updateEnemyList();
    }
    
    private void updateEnemyList(){
        mObjectModel.clear();
        Enumeration<String> keys = enemies.keys();
        while(keys.hasMoreElements()){
            mObjectModel.addElement(keys.nextElement());
        }
    }
    
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new EnemyEditor().setVisible(true);
            }
        });
       /* JEP j = new JEP();
        j.addStandardConstants();
        j.addStandardFunctions();
        j.addComplex();
        j.setAllowUndeclared(true);
        j.setImplicitMul(true);
        j.setAllowAssignment(true);
// parse assignment equations
        long start = Calendar.getInstance().getTimeInMillis();
        j.parseExpression("x=sin(y)");
        j.addVariable("y",90);
        for(int i=0;i<90;i++){
            j.setVarValue("y", i);
            System.out.println(j.getValue());
        }
        
        
        System.out.println((Calendar.getInstance().getTimeInMillis() - start));*/
    }
    
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton jAddExtension;
    private javax.swing.JButton jAddModifyEnemy;
    private javax.swing.JButton jAddModifyProjectile;
    private javax.swing.JButton jAddModifyWeapon;
    private javax.swing.JButton jAddModifyWorldObject;
    private javax.swing.JButton jAddProjectileGroup;
    private javax.swing.JButton jAddWeapon;
    private javax.swing.JButton jAddWorldObjectExtension;
    private javax.swing.JButton jCloseAddEnemyFrame;
    private javax.swing.JButton jCloseExtensionFrame;
    private javax.swing.JTextField jCollisionDamage;
    private javax.swing.JTextField jDestPath;
    private javax.swing.JTextField jDestPathProjectile;
    private javax.swing.JCheckBox jDestTrans;
    private javax.swing.JCheckBox jDestTransProjectile;
    private javax.swing.JButton jDoAddWeapon;
    private javax.swing.JButton jEditorRemoveWeapon;
    private javax.swing.JCheckBox jEnableShrapnel;
    private javax.swing.JList jEnemiesList;
    private javax.swing.JComboBox jEnemySelection;
    private javax.swing.JFrame jExtensionAddFrame;
    private javax.swing.JTextField jExtensionXPos;
    private javax.swing.JTextField jExtensionYPos;
    private javax.swing.JTextField jFanDegree;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel10;
    private javax.swing.JLabel jLabel11;
    private javax.swing.JLabel jLabel12;
    private javax.swing.JLabel jLabel13;
    private javax.swing.JLabel jLabel15;
    private javax.swing.JLabel jLabel16;
    private javax.swing.JLabel jLabel17;
    private javax.swing.JLabel jLabel18;
    private javax.swing.JLabel jLabel19;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel20;
    private javax.swing.JLabel jLabel21;
    private javax.swing.JLabel jLabel22;
    private javax.swing.JLabel jLabel23;
    private javax.swing.JLabel jLabel24;
    private javax.swing.JLabel jLabel25;
    private javax.swing.JLabel jLabel26;
    private javax.swing.JLabel jLabel27;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JLabel jLabel30;
    private javax.swing.JLabel jLabel31;
    private javax.swing.JLabel jLabel32;
    private javax.swing.JLabel jLabel33;
    private javax.swing.JLabel jLabel34;
    private javax.swing.JLabel jLabel35;
    private javax.swing.JLabel jLabel36;
    private javax.swing.JLabel jLabel37;
    private javax.swing.JLabel jLabel38;
    private javax.swing.JLabel jLabel39;
    private javax.swing.JLabel jLabel44;
    private javax.swing.JLabel jLabel47;
    private javax.swing.JLabel jLabel48;
    private javax.swing.JLabel jLabel49;
    private javax.swing.JLabel jLabel5;
    private javax.swing.JLabel jLabel50;
    private javax.swing.JLabel jLabel51;
    private javax.swing.JLabel jLabel52;
    private javax.swing.JLabel jLabel53;
    private javax.swing.JLabel jLabel6;
    private javax.swing.JLabel jLabel7;
    private javax.swing.JLabel jLabel8;
    private javax.swing.JLabel jLabel9;
    private javax.swing.JButton jLoadDest;
    private javax.swing.JButton jLoadDestProjectile;
    private javax.swing.JButton jLoadSprite;
    private javax.swing.JButton jLoadSpriteProjectile;
    private javax.swing.JButton jLoadWorldObjectSprite;
    private javax.swing.JTextField jMaxHealth;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JMenuItem jMenuItem1;
    private javax.swing.JMenuItem jMenuItem2;
    private javax.swing.JMenuItem jMenuItem3;
    private javax.swing.JTextField jName;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JPanel jPanel2;
    private javax.swing.JPanel jPanel3;
    private javax.swing.JPanel jPanel4;
    private javax.swing.JPanel jPanel5;
    private javax.swing.JButton jPreviewDest;
    private javax.swing.JButton jPreviewDestProjectile;
    private javax.swing.JFrame jPreviewFrame;
    private javax.swing.JLabel jPreviewLabel;
    private javax.swing.JSlider jPreviewSlider;
    private javax.swing.JButton jPreviewSprite;
    private javax.swing.JButton jPreviewSpriteProjectile;
    private javax.swing.JButton jPreviewWorldObjectSprite;
    private javax.swing.JCheckBox jProjectileBouncing;
    private javax.swing.JTextField jProjectileDamage;
    private javax.swing.JFrame jProjectileEditor;
    private javax.swing.JComboBox jProjectileGroup;
    private javax.swing.JTextField jProjectileGroupName;
    private javax.swing.JComboBox jProjectileGroupSelectionWeapon;
    private javax.swing.JList jProjectileList;
    private javax.swing.JTextField jProjectileMaxSpeed;
    private javax.swing.JTextField jProjectileName;
    private javax.swing.JCheckBox jProjectilePiercing;
    private javax.swing.JTextField jProjectileSpeedInc;
    private javax.swing.JTextField jProjectileStartSpeed;
    private javax.swing.JCheckBox jProjectileTracking;
    private javax.swing.JButton jRemoveEnemy;
    private javax.swing.JButton jRemoveEnemyWeapon;
    private javax.swing.JButton jRemoveProjectile;
    private javax.swing.JButton jRemoveProjectileGroup;
    private javax.swing.JButton jRemoveWorldObject;
    private javax.swing.JButton jRemoveWorldObjectExtension;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JScrollPane jScrollPane3;
    private javax.swing.JScrollPane jScrollPane4;
    private javax.swing.JScrollPane jScrollPane5;
    private javax.swing.JScrollPane jScrollPane6;
    private javax.swing.JSeparator jSeparator1;
    private javax.swing.JTextField jShotsPerSecond;
    private javax.swing.JCheckBoxMenuItem jShowProjectileEditor;
    private javax.swing.JCheckBoxMenuItem jShowWeaponEditor;
    private javax.swing.JCheckBoxMenuItem jShowWorldObjectEditor;
    private javax.swing.JTextField jShrapnelCount;
    private javax.swing.JComboBox jShrapnelDirection;
    private javax.swing.JComboBox jShrapnelProjectile;
    private javax.swing.JTextField jSpritePath;
    private javax.swing.JTextField jSpritePathProjectile;
    private javax.swing.JCheckBox jSpriteTrans;
    private javax.swing.JCheckBox jSpriteTransProjectile;
    private javax.swing.JComboBox jSupportedProjectiles;
    private javax.swing.JCheckBox jTrackPlayer;
    private javax.swing.JCheckBox jTransparencyWorldObjectSprite;
    private javax.swing.JFrame jWeaponAddFrame;
    private javax.swing.JTextField jWeaponDX;
    private javax.swing.JTextField jWeaponDY;
    private javax.swing.JFrame jWeaponEditor;
    private javax.swing.JList jWeaponList;
    private javax.swing.JTextField jWeaponName;
    private javax.swing.JComboBox jWeaponSelection;
    private javax.swing.JTable jWeaponsTable;
    private javax.swing.JFrame jWorldObjectEditor;
    private javax.swing.JTable jWorldObjectExtensions;
    private javax.swing.JList jWorldObjectList;
    private javax.swing.JTextField jWorldObjectName;
    private javax.swing.JTextField jWorldObjectSprite;
    private javax.swing.JTextField jXCountDest;
    private javax.swing.JTextField jXCountDestProjectile;
    private javax.swing.JTextField jXCountSprite;
    private javax.swing.JTextField jXCountSpriteProjectile;
    private javax.swing.JTextField jXCountWorldObjectSprite;
    private javax.swing.JTextField jYCountDest;
    private javax.swing.JTextField jYCountDestProjectile;
    private javax.swing.JTextField jYCountSprite;
    private javax.swing.JTextField jYCountSpriteProjectile;
    private javax.swing.JTextField jYCountWorldObjectSprite;
    // End of variables declaration//GEN-END:variables
    
}
